import Router from '@koa/router';
import userRoutes from './allroutes/system/userRoutes';
import authRoutes from './allroutes/system/authRoutes';
import menuRoutes from './allroutes/system/menuRoutes';
import dicRoutes from './allroutes/system/dicRoutes';
import roleRoutes from './allroutes/system/roleRoutes';
import tenantRoutes from './allroutes/system/tenantRoutes';
import permissionRoutes from './allroutes/system/permissionRoutes';
export const router = new Router();
// API 版本前缀
router.prefix('/api/v1');
// 认证路由
router.use('/auth', authRoutes.routes(), authRoutes.allowedMethods());
// 用户路由
router.use('/users', userRoutes.routes(), userRoutes.allowedMethods());
// 菜单路由
router.use('/menus', menuRoutes.routes(), menuRoutes.allowedMethods());
// 字典项路由
router.use('/dics', dicRoutes.routes(), dicRoutes.allowedMethods());
// 角色路由
router.use('/roles', roleRoutes.routes(), roleRoutes.allowedMethods());
// 租户路由
router.use('/tenants', tenantRoutes.routes(), tenantRoutes.allowedMethods());
// 权限路由
router.use('/permissions', permissionRoutes.routes(), permissionRoutes.allowedMethods());

// import apiRoutes from './allroutes/system/apiRoutes';
// router.use('/apis', apiRoutes.routes(), apiRoutes.allowedMethods());

export default router;